using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Generalization
{
    /// <summary>
    /// <para>Eliminate</para>
    /// <para>Eliminates polygons by merging them with neighboring polygons that have the largest area or the longest shared border. Eliminate is often used to remove small sliver polygons that are the result of overlay operations, such as Intersect or Union.</para>
    /// <para>通过将多边形与具有最大面积或最长共享边界的相邻多边形合并来消除多边形。消除通常用于移除由叠加操作（如“相交”或“并集”）产生的小条形。</para>
    /// </summary>    
    [DisplayName("Eliminate")]
    public class Eliminate : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Eliminate()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Layer</para>
        /// <para>The layer whose polygons will be merged into neighboring polygons.</para>
        /// <para>其面将合并到相邻面中的图层。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The feature class to be created.</para>
        /// <para>要创建的要素类。</para>
        /// </param>
        public Eliminate(object _in_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Eliminate";

        public override string CallName => "management.Eliminate";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "qualifiedFieldNames", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _out_feature_class, _selection.GetGPValue(), _ex_where_clause, _ex_features];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The layer whose polygons will be merged into neighboring polygons.</para>
        /// <para>其面将合并到相邻面中的图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The feature class to be created.</para>
        /// <para>要创建的要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Eliminating polygon by border</para>
        /// <para><xdoc>
        ///   <para>These options specify which method will be used for eliminating features.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Merges a selected polygon with a neighboring unselected polygon by dropping the shared border. The neighboring polygon is the one with the longest shared border. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Merges a selected polygon with a neighboring unselected polygon by dropping the shared border. The neighboring polygon is the one with the largest area.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>这些选项指定将用于消除特征的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 通过删除共享边框将选定面与相邻的未选定面合并。相邻的多边形是共享边界最长的多边形。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 通过删除共享边框将选定面与相邻的未选定面合并。相邻的多边形是面积最大的多边形。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Eliminating polygon by border")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _selection_value _selection { get; set; } = _selection_value._true;

        public enum _selection_value
        {
            /// <summary>
            /// <para>LENGTH</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("LENGTH")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>AREA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("AREA")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Exclusion Expression</para>
        /// <para>An SQL expression used to identify features that will not be altered.</para>
        /// <para>用于标识不会更改的特征的 SQL 表达式。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Exclusion Expression")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _ex_where_clause { get; set; } = null;


        /// <summary>
        /// <para>Exclusion Layer</para>
        /// <para>An input polyline or polygon feature class or layer that defines polygon boundaries, or portions thereof, that should not be eliminated.</para>
        /// <para>用于定义不应消除的面边界或其部分的输入折线或面要素类或图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Exclusion Layer")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _ex_features { get; set; } = null;


        public Eliminate SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, bool? qualifiedFieldNames = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, qualifiedFieldNames: qualifiedFieldNames, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}